package com.springboot.study.tests;

import java.text.SimpleDateFormat;
import java.util.regex.Pattern;

/**
 * @Author: guodong
 * @Date: 2021/6/9 9:33
 * @Version: 1.0
 * @Description:
 */
public class DateMatchTest {



    public static void tes001(){
        String timeRegex2 = "(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})\\/(((0[13578]|1[02])\\/(0[1-9]|[12][0-9]|3[01]))|"+
                "((0[469]|11)\\/(0[1-9]|[12][0-9]|30))|(02\\/(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|"+
                "((0[48]|[2468][048]|[3579][26])00))\\/02\\/29)$";

        System.out.println(Pattern.matches(timeRegex2,"2018/02/10"));
    }



    public static void tes002(){
        String aa = "^[1-9]\\d{3}\\/((0?[1-9])|1[0-2])\\/((0?[1-9])|[1-2][0-9]|3[0-1])$";
        System.out.println(Pattern.matches(aa,"2018/02/10"));
    }


    public static void main(String[] args) {
        tes002();
    }


}
